import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
import java.security.PublicKey;
import java.security.SecureRandom;


public class RemoteServer {

	//Generate and getPublicKey
	public PublicKey getPublicKey() throws NoSuchAlgorithmException, NoSuchProviderException {
		
		KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA", "BC");
	    keyGen.initialize(512, new SecureRandom());
	    KeyPair keyPair = keyGen.generateKeyPair();
	    
	    java.io.FileOutputStream fos = new java.io.FileOutputStream("test.txt"); 
	    
	    fos.close();
	    
	    
	    return keyPair.getPublic();
	}
	
	
	
	//A method to send the encryped credit card number
	//A method to get the encrypted credit card number
	//A method to send the encrypted symmetric key
	//A method to get the encrypted symmetric key

}
